/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package banco_imobiliario.dao;

import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.sqlite.*;


/**
 *
 * @author alessandro
 */
public class DAOConection {

    private static final String DB_DRIVER = "org.sqlite.JDBC";
    private static final String DB_CONNECTION = "jdbc:sqlite:BancoImobiliario.db";
    
    public static Connection getConnection(){
        
        Connection connection = null;
        try {
            
            Class.forName(DB_DRIVER);     
            connection = DriverManager.getConnection(DB_CONNECTION);
            
        } catch (ClassNotFoundException ex) {
            System.err.println("Erro! O driver " + DB_DRIVER + " não foi encontrado : " + ex);    
        } catch (SQLException ex) {
            System.err.println("Erro ao abrir o banco com o driver " + DB_CONNECTION + " : " + ex);
        }
              
        return connection;
    }
            
    
    
}
















